package com.sicau.smart_farmer.service;

import com.sicau.smart_farmer.entity.UserType;
import com.sicau.smart_farmer.repository.UserTypeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserTypeService {

    @Autowired
    private MongoTemplate mongoTemplate;

    @Autowired
    private UserTypeRepository userTypeRepository;

    /**
     * 获取所有的用户类型
     * @return
     */
    public List<UserType> getAllUserType(){
        List<UserType> all = userTypeRepository.findAll();
        return all;
    }

}
